package net.yxsoft.websocket.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.group.ChannelGroup;
import net.yxsoft.websocket.MessageServer;
import net.yxsoft.websocket.MessageServerSession;
import rapid.netty.command.CommandGroup;
import rapid.netty.handler.WebSocketHandler;
import rapid.util.Kit;

public class MessageServerHandler extends WebSocketHandler {
  public MessageServerHandler(ChannelGroup channelGroup, CommandGroup commandGroup) {
    super(channelGroup, commandGroup);
  }

  @Override
  protected void onConnect(ChannelHandlerContext ctx) {
    Kit.println("已连接");
  }

  @Override
  protected void onDisconnect(ChannelHandlerContext ctx) {

    Kit.println("已断开");

    //MessageServer.removeUser(ctx);

    MessageServerSession.removSession(ctx);

    Kit.println("已移除");
  }
}
